<div class="max-w-3xl mx-auto">
    <h2 class="text-xl font-semibold mb-6 text-center">环境检测</h2>
    
    <div class="overflow-x-auto">
        <table class="min-w-full bg-white">
            <thead>
                <tr class="bg-gray-50">
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">检测项目</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">所需配置</th>
                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">当前配置</th>

                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">状态</th>
                </tr>
            </thead>
            <tbody class="divide-y divide-gray-200">
                <?php 
                $hasError = false;
                foreach ($systemInfo as $item): 
                    if (strpos($item['status'], 'error') !== false) {
                        $hasError = true;
                    }
                ?>
                <tr>
                    <td class="px-6 py-4"><?php echo $item['name']; ?></td>
                    <td class="px-6 py-4"><?php echo $item['version']; ?></td>
                    <td class="px-6 py-4"><?php echo $item['default']; ?></td>
                    <td class="px-6 py-4"><?php echo $item['status']; ?></td>
                </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>

    <?php if ($hasError): ?>
    <div class="mt-6 text-center">
        <div class="text-red-500 mb-4">
            ⚠️ 检测到环境存在问题，请解决后继续安装
        </div>
    </div>
    <?php endif; ?>

    <div class="mt-8 text-center space-x-4">
        <a href="index.php?action=index" class="bg-gray-500 text-white px-6 py-2 rounded-md hover:bg-gray-600 transition-colors">
            上一步：安装须知
        </a>
        <?php if (!$hasError): ?>
        <a href="index.php?action=db-config" class="bg-blue-500 text-white px-6 py-2 rounded-md hover:bg-blue-600 transition-colors">
            下一步：配置数据库
        </a>
        <?php else: ?>
        <button disabled class="bg-blue-500 text-white px-6 py-2 rounded-md opacity-50 cursor-not-allowed">
            下一步：配置数据库
        </button>
        <?php endif; ?>
    </div>
</div> 